#pragma once

class CAppConfig
{
public:
	CAppConfig();
	~CAppConfig();

	bool Init();
	void Exit();

	struct PluginCfg
	{
		std::wstring strPluginName;
		std::wstring strPluginDll;
	};

	struct SubDirCfg
	{
		std::wstring strSubPath;
		std::wstring strPluginName;
		std::wstring strServerInfo;
	};

	const std::wstring& GetClientRoot() const { return m_strClientRoot; }
	const std::vector<PluginCfg>& GetPluginCfgs() const { return m_vecPluginCfgs; }
	const std::vector<SubDirCfg>& GetSubDirCfgs() const { return m_vecSubDirCfgs; }

private:
	bool LoadClientRoot(LPCWSTR lpFileName);
	bool LoadPluginCfgs(LPCWSTR lpFileName);
	bool LoadSubDirCfgs(LPCWSTR lpFileName);
	void InsertSubDirCfg(SubDirCfg&& subDirCfg);

	std::wstring m_strClientRoot;
	std::vector<PluginCfg> m_vecPluginCfgs;
	std::vector<SubDirCfg> m_vecSubDirCfgs;
};
